import request from '@/utils/request'

// 查询会员信息列表
export function listMemberInfo(query) {
  return request({
    url: '/crm/memberInfo/list',
    method: 'get',
    params: query
  })
}

// 查询会员信息列表
export function queryMemberInfo(query) {
  return request({
    url: '/crm/memberInfo/query',
    method: 'get',
    params: {'value':query}
  })
}



// 查询会员信息详细
export function getMemberInfo(id) {
  return request({
    url: '/crm/memberInfo/' + id,
    method: 'get'
  })
}

export function getPhone(id) {
  return request({
    url: '/crm/memberInfo/getPhone?id=' + id,
    method: 'get'
  })
}

// 新增会员信息
export function addMemberInfo(data) {
  return request({
    url: '/crm/memberInfo',
    method: 'post',
    data: data
  })
}

//更换会员等级
export function changeGrade(id,grade) {
  return request({
    url: '/crm/memberInfo/changeGrade',
    method: 'post',
    data: {'id':id,'grade':grade}
  })
}

// 修改会员信息
export function updateMemberInfo(data) {
  return request({
    url: '/crm/memberInfo',
    method: 'put',
    data: data
  })
}

// 删除会员信息
export function delMemberInfo(id) {
  return request({
    url: '/crm/memberInfo/' + id,
    method: 'delete'
  })
}
